<?php
/**
 * Created by PhpStorm.
 * User: mj
 * Date: 17-5-25
 * Time: 下午3:44
 */

namespace App\Winged\Patients\Service;
use Faker\Provider\Uuid;


class Helpers
{

    const DIRECTORY_SEPARATOR = '/';
    const DOT = '.';
    /**
     * 生成oss的存储名字
     * @param $file
     * @return string
     */
    public static function generateFileName($file)
    {
        $uuid = str_replace('-', '', Uuid::uuid());
        return app()->tenant->getUuid() . self::DIRECTORY_SEPARATOR . $uuid . self::DOT . $file->guessExtension();
    }

    public static function generateArticleName()
    {
        $uuid = str_replace('-', '', Uuid::uuid());
        return app()->tenant->getUuid() . self::DIRECTORY_SEPARATOR . "article-" . $uuid. ".html" ;
    }
}
